<?php
/**
 * Assets packer V1.0
 *
 *
 *
 **/

if( !defined( 'DS' ) ) define( 'DS', DIRECTORY_SEPARATOR );

$hash = $_GET['h'];
if( strlen( $hash ) !== 32 ) die();
if( $right_hash = preg_match( "#[a-z0-9]{32}#", $hash ) ) {

	if (extension_loaded('zlib') && !ini_get('zlib.output_compression')) @ob_start('ob_gzhandler');
	header('Content-type: text/'.($_GET['t']=='css'?'css':'javascipt').'; charset: UTF-8');
	header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 86400) . ' GMT');

	$xpath	= dirname( __FILE__ );
	$xpath	= explode( 'components', $xpath );
	$file	= $xpath[0].'cache'.DS.'com_true'.DS.$hash.'.php';
	if( file_exists( $file ) ) {
		if( $data = file_get_contents( $file ) ) {
			// Remove the initial die() statement
			$data = preg_replace( '/^.*\n/', '', $data );
		}
		$data = unserialize( $data );
		echo $data['result'];
	} else {
		echo '';
	}
}
?>